<!DOCTYPE html>
<html lang="zh">
<head>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/static/include/css/style.css">
    <link href="/static/ajax/libs/select2/select2.min.css" rel="stylesheet"/>
    <link href="/static/ajax/libs/select2/select2-bootstrap.css" rel="stylesheet"/>
    <style type="text/css">
      .select-table table {
        table-layout: fixed;
      }

      .table > thead > tr > th {
        text-align: center;
      }

      .select-table .table td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .form-control {
        padding: 3px 6px 4px;
        height: 30px;
      }

      .icheckbox-blue {
        top: 0px;
        left: 6px;
      }

      .form-control.select2-hidden-accessible {
        position: static !important;
      }

      .select-table table label.error {
        position: inherit;
      }

      select + label.error {
        z-index: 1;
        right: 40px;
      }
    </style>
  </head>
<body class="gray-bg"
      style="font: 14px Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif !important;">
<section class="section-content">
  <div class="row">
    <div class="col-xs-12">
      <div class="ibox float-e-margins">
        <div class="ibox-content" style="border-style:none;">
          <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
              <li><a href="#tab-basic" data-toggle="tab" aria-expanded="false">基本信息</a></li>
              <li class="active"><a href="#tab-field" data-toggle="tab" aria-expanded="true">字段信息</a></li>
              <li><a href="#tab-gen" data-toggle="tab" aria-expanded="false">生成信息</a></li>
              <li class="pull-right header">
                <i class="fa fa-code"></i> 生成配置
              </li>
            </ul>
            <form id="form-gen-edit" class="form-horizontal">
              <input name="tableId" type="hidden" field="tableId"/>
              <div class="tab-content">
                <!-- 基本信息 -->
                <div class="tab-pane" id="tab-basic">
                  <div class="row mt20">
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required">表名称：</label>
                        <div class="col-sm-8">
                          <input name="tableName" class="form-control" type="text" placeholder="请输入表名称" maxlength="100"
                                 field="tableName" required>
                        </div>
                      </div>
                    </div>
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required">表描述：</label>
                        <div class="col-sm-8">
                          <input name="tableComment" class="form-control" type="text" placeholder="请输入表描述"
                                 maxlength="100" field="tableComment" required>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required">实体类名称：</label>
                        <div class="col-sm-8">
                          <input name="className" class="form-control" type="text" placeholder="请输入实体类名称"
                                 maxlength="100" field="className" required>
                        </div>
                      </div>
                    </div>
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required">作者：</label>
                        <div class="col-sm-8">
                          <input name="functionAuthor" class="form-control" type="text" placeholder="请输入作者"
                                 maxlength="50" field="functionAuthor" required>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-12">
                      <div class="form-group">
                        <label class="col-xs-2 control-label">备注：</label>
                        <div class="col-xs-10">
                          <textarea name="remark" maxlength="500" class="form-control" rows="3"
                                    field="remark"></textarea>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>

                <!-- 字段信息 -->
                <div class="tab-pane active" id="tab-field">
                  <div class="select-table table-striped" style="margin-top: 0px;padding-top: 0px;padding-bottom: 0px;">
                    <table id="bootstrap-table" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
                  </div>
                </div>

                <!-- 生成信息 -->
                <div class="tab-pane" id="tab-gen">
                  <div class="row mt20">
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required">生成模板：</label>
                        <div class="col-sm-8">
                          <select class='form-control' field="tplCategory" id="tplCategory" name='tplCategory' style="width: 100%">
                            <option value="crud">单表（增删改查）</option>
                         <!--   <option value="tree">树表（增删改查）</option> -->
                          </select>
                        </div>
                      </div>
                    </div>
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="基础java包路径，例如 com.framework.bdf4j">生成包路径：<i
                            class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                          <input name="packageName" class="form-control" type="text" placeholder="请输入生成包路径"
                                 maxlength="100" field="packageName" required>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="模块英文名，例如 sysadm">生成模块名：<i
                            class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                          <input name="moduleName" class="form-control" type="text" placeholder="请输入生成模块名"
                                 maxlength="30" field="moduleName" required>
                        </div>
                      </div>
                    </div>
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="功能英文名，例如 user">生成业务名：<i
                            class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                          <input name="businessName" class="form-control" type="text" placeholder="请输入生成业务名"
                                 maxlength="30" field="businessName" required>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-6">
                      <div class="form-group">
                        <label class="col-sm-4 control-label is-required" title="用作类描述，例如 用户">生成功能名：<i
                            class="fa fa-question-circle-o"></i></label>
                        <div class="col-sm-8">
                          <input name="functionName" class="form-control" type="text" placeholder="请输入生成功能名"
                                 maxlength="50" field="functionName" required>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="hidden" id="otherInfo">
                    <h4 class="form-header h4">其他信息</h4>
                    <div class="row">
                      <div class="col-sm-6">
                        <div class="form-group">
                          <label class="col-sm-4 control-label is-required" title="树显示的编码字段名， 如：dept_id">树编码字段：<i
                              class="fa fa-question-circle-o"></i></label>
                          <div class="col-sm-8">
                            <select class='form-control' id="treeCode" field="treeCode" name='params[treeCode]' style="width: 100%">
                              <option value="">---请选择---</option>
                            </select>
                          </div>
                        </div>
                      </div>
                      <div class="col-sm-6">
                        <div class="form-group">
                          <label class="col-sm-4 control-label is-required" title="树显示的父编码字段名， 如：parent_Id">树父编码字段：<i
                              class="fa fa-question-circle-o"></i></label>
                          <div class="col-sm-8">
                            <select class='form-control' id="treeParentCode" field="treeParentCode" name='params[treeParentCode]'
                                    style="width: 100%">
                              <option value="">---请选择---</option>
                            </select>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="row">
                      <div class="col-sm-6">
                        <div class="form-group">
                          <label class="col-sm-4 control-label is-required" title="树节点的显示名称字段名， 如：dept_name">树名称字段：<i
                              class="fa fa-question-circle-o"></i></label>
                          <div class="col-sm-8">
                            <select class='form-control' id="treeName" field="treeName" name='params[treeName]' style="width: 100%">
                              <option value="">---请选择---</option>
                            </select>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </form>
          </div>
        </div>
        <div class="box-footer">
          <div class="col-sm-offset-5 col-sm-6">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保
              存
            </button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<script src="/static/include/js/footer.js"></script>
<script src="/static/pages/tool/gen/edit.js"></script>
<script src="/static/ajax/libs/select2/select2.min.js"></script>
<script src="/static/ajax/libs/bootstrap-table/extensions/reorder/bootstrap-table-reorder.js"></script>
<script src="/static/ajax/libs/bootstrap-table/extensions/reorder/jquery.tablednd.js"></script>
<script src="/static/js/jquery.tmpl.js"></script>
</body>
</html>


<!-- java类型 -->
<script id="javaTypeTpl" type="text/x-jquery-tmpl">
<div>
<select class='form-control' name='columns[${index}].javaType'>
    <option value="Long" {{if javaType==="Long"}}selected{{/if}}>Long</option>
    <option value="String" {{if javaType==="String"}}selected{{/if}}>String</option>
    <option value="Integer" {{if javaType==="Integer"}}selected{{/if}}>Integer</option>
    <option value="Double" {{if javaType==="Double"}}selected{{/if}}>Double</option>
    <option value="BigDecimal" {{if javaType==="BigDecimal"}}selected{{/if}}>BigDecimal</option>
    <option value="Date" {{if javaType==="Date"}}selected{{/if}}>Date</option>
</select>
</div>
</script>

<!-- 查询方式 -->
<script id="queryTypeTpl" type="text/x-jquery-tmpl">
<div>
<select class='form-control' name='columns[${index}].queryType'>
    <option value="EQ" {{if queryType==="EQ"}}selected{{/if}}>=</option>
    <option value="NE" {{if queryType==="NE"}}selected{{/if}}>!=</option>
    <option value="GT" {{if queryType==="GT"}}selected{{/if}}>></option>
    <option value="GTE" {{if queryType==="GTE"}}selected{{/if}}>>=</option>
    <option value="LT" {{if queryType==="LT"}}selected{{/if}}><</option>
    <option value="LTE" {{if queryType==="LTE"}}selected{{/if}}><=</option>
    <option value="LIKE" {{if queryType==="LIKE"}}selected{{/if}}>Like</option>
    <option value="BETWEEN" {{if queryType==="BETWEEN"}}selected{{/if}}>Between</option>
</select>
</div>
</script>

<!-- 显示类型 -->
<script id="htmlTypeTpl" type="text/x-jquery-tmpl">
<div>
<select class='form-control' name='columns[${index}].htmlType'>
    <option value="input" {{if htmlType==="input"}}selected{{/if}}>文本框</option>
    <option value="textarea" {{if htmlType==="textarea"}}selected{{/if}}>文本域</option>
    <option value="select" {{if htmlType==="select"}}selected{{/if}}>下拉框</option>
    <option value="radio" {{if htmlType==="radio"}}selected{{/if}}>单选框</option>
    <option value="checkbox" {{if htmlType==="checkbox"}}selected{{/if}}>复选框</option>
    <option value="datetime" {{if htmlType==="datetime"}}selected{{/if}}>日期控件</option>
</select>
</div>
</script>
